package com.dng.book.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 用户实体类
 *
 * @author dng
 * @since 2024-01-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("T_USER")
@Schema(description = "用户实体")
public class User {

    @Schema(description = "ID")
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    @Schema(description = "用户名")
    @TableField("USERNAME")
    private String username;

    @Schema(description = "密码")
    @TableField("PASSWORD")
    private String password;

    @Schema(description = "手机号")
    @TableField("PHONE")
    private String phone;

    @Schema(description = "头像URL")
    @TableField("AVATAR")
    private String avatar;

    @Schema(description = "创建人")
    @TableField("CREATED_BY")
    private String createdBy;

    @Schema(description = "创建时间")
    @TableField("CREATED_TIME")
    private LocalDateTime createdTime;

    @Schema(description = "更新人")
    @TableField("UPDATED_BY")
    private String updatedBy;

    @Schema(description = "更新时间")
    @TableField("UPDATED_TIME")
    private LocalDateTime updatedTime;

    @Schema(description = "删除标识 0：未删除1：已删除默认：0")
    @TableField("DEL_FLAG")
    @TableLogic
    private String delFlag;

    @Schema(description = "乐观锁")
    @TableField("REVISION")
    @Version
    private Integer revision;

    @Schema(description = "备注")
    @TableField("NOTE")
    private String note;
} 